-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update release.yml #54
Conversation
Neat stuff! Thank you! |
@amontoison do you know if there's a way to automatically create a new discussion for the release in Announcements, like #15? |
@cvanaret name: Post Release Announcement
on:
release:
types: [published] # Se déclenche lorsqu'une release est publiée
jobs:
delay_and_announce:
runs-on: ubuntu-latest
steps:
- name: Attendre 24 heures
run: sleep $((24 * 60 * 60)) # Attend 24 heures (86400 secondes)
- name: Obtenir les notes de release
id: get_release_notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Récupère les informations de la dernière release
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases/latest)
# Extraire le titre et le corps de la release
echo "::set-output name=title::$(echo "$response" | jq -r '.name')"
echo "::set-output name=body::$(echo "$response" | jq -r '.body')"
- name: Poster l'annonce dans les Discussions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Remplacez '123456' par l'ID de la catégorie où l'annonce doit être postée
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/discussions \
-d "{\"title\": \"Nouvelle Release : ${{ steps.get_release_notes.outputs.title }}\", \"body\": \"${{ steps.get_release_notes.outputs.body }}\", \"category_id\": 123456}" The idea is to wait a few hours or one day after that a release is created to do a new announcement. It will copy-paste the content of the release note and use it for the announcement. |
@amontoison thank you very much! |
Do you want that I open a PR to add a workflow? |
If you find time, sure. It's not urgent though. |
@cvanaret
I tested the script for the release on my fork and added some fixes.
I have now an example of release automatically generated here:
https://github.com/amontoison/Uno/releases/tag/v1.2.0